package com.wdd.recoveryvehicle.mapper;

import com.wdd.recoveryvehicle.menuItem.bean.MenuItemVB;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 菜单列表
 *
 * @author globalMr
 */
@Mapper
@Repository
public interface MenuItemMappler {

    @Select(" select " +
            " id, icon, item, path, parent_id " +
            " from menu_item " +
            " where useful = 1 and parent_id = 0 ")
    List<MenuItemVB> selectParentList();

    @Select(" select " +
            " id, icon, item, path, parent_id " +
            " from menu_item " +
            " where useful = 1 and parent_id = #{id} ")
    List<MenuItemVB> selectChildList(@RequestParam("id") String id);











}
